# Import packages
Warning messages:
1: In readChar(file, size, TRUE) : truncating string with embedded nuls
2: In readChar(file, size, TRUE) : truncating string with embedded nuls
library(dplyr)
library(data.table)
library(ggplot2)
library(pastecs)
# Setting environment
Warning messages:
1: In readChar(file, size, TRUE) : truncating string with embedded nuls
2: In readChar(file, size, TRUE) : truncating string with embedded nuls
3: In readChar(file, size, TRUE) : truncating string with embedded nuls
4: In readChar(file, size, TRUE) : truncating string with embedded nuls
5: In readChar(file, size, TRUE) : truncating string with embedded nuls
6: In readChar(file, size, TRUE) : truncating string with embedded nuls
7: In readChar(file, size, TRUE) : truncating string with embedded nuls
8: In readChar(file, size, TRUE) : truncating string with embedded nuls
9: In readChar(file, size, TRUE) : truncating string with embedded nuls
# remove(list=ls())
# setwd("C:\\Users\\sunil\\Downloads\\College\\DAV\\Project")
# make evironment not to change large number to exponential
options(scipen = 999)
# Import dataset
nepal_dt <- read.csv("Source Dataset-API_NPL_DS2.csv", skip=4, header=TRUE, stringsAsFactors = FALSE)
meta_country <- read.csv("MetaData_Country.csv", header=TRUE, stringsAsFactors = FALSE)
meta_indictr <- read.csv("MetaData_Indicator.csv", header=TRUE, stringsAsFactors = FALSE)
nepal_dt
meta_country
meta_indictr
Data Preparation: Preparing data after the import
temp_df = filter(nepal_dt, grepl("tax", tolower(IndicatorName), fixed = TRUE) | grepl("tax", tolower(IndicatorCode), fixed = TRUE))
nepal_df <- temp_df
nepal_df
dim(nepal_df)
[1] 53 66
temp_df = filter(nepal_dt, grepl("gdp", tolower(IndicatorName), fixed = TRUE) | grepl("gdp", tolower(IndicatorCode), fixed = TRUE))
nepal_df <- rbind(nepal_df, temp_df)
nepal_df
dim(nepal_df)
[1] 143 66
temp_df = filter(nepal_dt, grepl("employment", tolower(IndicatorName), fixed = TRUE) | grepl("employment", tolower(IndicatorCode), fixed = TRUE))
nepal_df <- rbind(nepal_df, temp_df)
nepal_df
# Drop first and second column
nepal_df <- nepal_df[-c(1,2)]
nepal_df
# unique(nepal_df$IndicatorName)
#table(tolower(nepal_df$IndicatorName))
# Transposing the dataframe
# t(nepal_df)
df_t <- transpose(nepal_df)
rownames(df_t) <- colnames(nepal_df)
colnames(df_t) <- rownames(nepal_df)
# Rename the columns with the first row. Columns are not properly renamed from above lines.
colnames(df_t) <- df_t[2,]
# Remove the first and second row.
df_t <- df_t[-1:-2,]
nepal_df <- df_t
nepal_df
# Keep rownames as a first column
#setDT(df_t, keep.rownames = TRUE)[]
nepal_df <- cbind(names = rownames(nepal_df), nepal_df)
colnames(nepal_df)[1] <- "YEAR"
# Removing a character 'X' from the column: YEAR in nepal_df
nepal_df$YEAR <- gsub("X","",as.character(nepal_df$YEAR))
nepal_df
dim(nepal_df)[2]
[1] 243
# Converting columns to numeric types
#nepal_df$TM.TAX.MRCH.WM.AR.ZS = as.numeric(as.character(nepal_df$TM.TAX.MRCH.WM.AR.ZS))
#nepal_df$NY.GDP.PETR.RT.ZS = as.numeric(as.character(nepal_df$NY.GDP.PETR.RT.ZS))
nepal_df[1:dim(nepal_df)[2]] <- sapply(nepal_df[1:dim(nepal_df)[2]],as.numeric)
sapply(nepal_df, class)
YEAR TM.TAX.MRCH.WM.AR.ZS TM.TAX.MRCH.IP.ZS NY.TAX.NIND.KN TM.TAX.TCOM.BC.ZS
"numeric" "numeric" "numeric" "numeric" "numeric"
TM.TAX.MANF.BC.ZS GC.TAX.INTT.RV.ZS TM.TAX.MRCH.WM.FN.ZS TM.TAX.MRCH.SM.AR.ZS TM.TAX.TCOM.IP.ZS
"numeric" "numeric" "numeric" "numeric" "numeric"
TM.TAX.MANF.IP.ZS IC.TAX.GIFT.ZS GC.TAX.TOTL.GD.ZS GC.TAX.GSRV.VA.ZS IC.TAX.LABR.CP.ZS
"numeric" "numeric" "numeric" "numeric" "numeric"
GC.TAX.YPKG.CN TM.TAX.MRCH.BR.ZS NY.TAX.NIND.CN TM.TAX.MRCH.SR.ZS IC.TAX.OTHR.CP.ZS
"numeric" "numeric" "numeric" "numeric" "numeric"
GC.TAX.YPKG.ZS GC.TAX.IMPT.ZS GC.TAX.OTHR.CN GC.TAX.IMPT.CN TM.TAX.TCOM.WM.AR.ZS
"numeric" "numeric" "numeric" "numeric" "numeric"
TM.TAX.MANF.WM.AR.ZS IC.TAX.PAYM GC.TAX.EXPT.CN IC.TAX.TOTL.CP.ZS IC.FRM.INFM.ZS
"numeric" "numeric" "numeric" "numeric" "numeric"
GC.TAX.GSRV.CN GC.TAX.INTT.CN TM.TAX.TCOM.WM.FN.ZS TM.TAX.MANF.WM.FN.ZS TM.TAX.MRCH.SM.FN.ZS
"numeric" "numeric" "numeric" "numeric" "numeric"
TM.TAX.TCOM.SM.AR.ZS TM.TAX.MANF.SM.AR.ZS IC.FRM.METG.ZS GC.TAX.GSRV.RV.ZS TM.TAX.MRCH.BC.ZS
"numeric" "numeric" "numeric" "numeric" "numeric"
NY.TAX.NIND.CD TM.TAX.TCOM.SM.FN.ZS TM.TAX.MANF.SM.FN.ZS IC.TAX.METG GC.TAX.YPKG.RV.ZS
"numeric" "numeric" "numeric" "numeric" "numeric"
IC.TAX.DURS GC.TAX.TOTL.CN TM.TAX.TCOM.BR.ZS TM.TAX.MANF.BR.ZS TM.TAX.TCOM.SR.ZS
"numeric" "numeric" "numeric" "numeric" "numeric"
TM.TAX.MANF.SR.ZS IC.TAX.PRFT.CP.ZS GC.TAX.EXPT.ZS GC.TAX.OTHR.RV.ZS TG.VAL.TOTL.GD.ZS
"numeric" "numeric" "numeric" "numeric" "numeric"
NY.GDP.MKTP.KD NY.GDP.COAL.RT.ZS NY.GDP.PCAP.PP.KD NY.GDP.MINR.RT.ZS NY.GDP.MKTP.KN
"numeric" "numeric" "numeric" "numeric" "numeric"
NY.GDP.DEFL.KD.ZG.AD NV.SRV.TOTL.ZS ER.GDP.FWTL.M3.KD BX.TRF.PWKR.DT.GD.ZS SL.GDP.PCAP.EM.KD
"numeric" "numeric" "numeric" "numeric" "numeric"
SE.XPD.TERT.PC.ZS NY.GDS.TOTL.ZS NY.GDP.MKTP.KD.ZG NY.GDP.DEFL.KD.ZG SH.XPD.CHEX.GD.ZS
"numeric" "numeric" "numeric" "numeric" "numeric"
SE.XPD.PRIM.PC.ZS NY.GDP.PETR.RT.ZS NY.GDP.MKTP.CD NE.DAB.TOTL.ZS SH.XPD.GHED.GD.ZS
"numeric" "numeric" "numeric" "numeric" "numeric"
SE.XPD.TOTL.GD.ZS PA.NUS.PPPC.RF NY.GDP.MKTP.PP.KD NY.GDP.DEFL.ZS.AD NE.GDI.TOTL.ZS
"numeric" "numeric" "numeric" "numeric" "numeric"
GC.TAX.TOTL.GD.ZS FS.AST.DOMS.GD.ZS FM.AST.PRVT.GD.ZS EN.ATM.CO2E.KD.GD NY.GDP.PCAP.PP.CD
"numeric" "numeric" "numeric" "numeric" "numeric"
NY.GDP.FRST.RT.ZS NE.GDI.FTOT.ZS SE.XPD.SECO.PC.ZS NY.GDP.MKTP.CN.AD NV.IND.MANF.ZS
"numeric" "numeric" "numeric" "numeric" "numeric"
NE.TRD.GNFS.ZS GC.REV.XGRT.GD.ZS GB.XPD.RSDV.GD.ZS EG.USE.COMM.GD.PP.KD GC.NLD.TOTL.GD.ZS
"numeric" "numeric" "numeric" "numeric" "numeric"
BN.CAB.XOKA.GD.ZS BG.GSR.NFSV.GD.ZS NE.CON.PRVT.ZS GC.LBL.TOTL.GD.ZS FS.AST.PRVT.GD.ZS
"numeric" "numeric" "numeric" "numeric" "numeric"
BM.KLT.DINV.WD.GD.ZS NY.GDP.PCAP.KD NY.GDP.FCST.CN FS.AST.CGOV.GD.ZS EN.ATM.CO2E.PP.GD
"numeric" "numeric" "numeric" "numeric" "numeric"
EG.GDP.PUSE.KO.PP.KD EG.EGY.PRIM.PP.KD GC.NFN.TOTL.GD.ZS FM.LBL.BMNY.GD.ZS NY.GDP.PCAP.KD.ZG
"numeric" "numeric" "numeric" "numeric" "numeric"
NY.GDP.FCST.KD NY.GDP.TOTL.RT.ZS NY.GDP.MKTP.CN NE.RSB.GNFS.ZS MS.MIL.XPND.GD.ZS
"numeric" "numeric" "numeric" "numeric" "numeric"
NY.GDP.NGAS.RT.ZS NY.GDP.DISC.CN NV.IND.TOTL.ZS NE.GDI.FPRV.ZS GC.DOD.TOTL.GD.ZS
"numeric" "numeric" "numeric" "numeric" "numeric"
FS.AST.DOMO.GD.ZS EN.ATM.CO2E.PP.GD.KD BX.KLT.DINV.WD.GD.ZS NY.GDP.PCAP.KN NY.GDP.FCST.KN
"numeric" "numeric" "numeric" "numeric" "numeric"
NE.IMP.GNFS.ZS NY.GNS.ICTR.ZS NY.GDP.PCAP.CD NY.GDP.DISC.KN NV.AGR.TOTL.ZS
"numeric" "numeric" "numeric" "numeric" "numeric"
CM.MKT.TRAD.GD.ZS CM.MKT.LCAP.GD.ZS PA.NUS.PPP NY.GDP.MKTP.PP.CD NY.GDP.DEFL.ZS
"numeric" "numeric" "numeric" "numeric" "numeric"
NE.EXP.GNFS.ZS NY.GDP.PCAP.CN NY.GDP.FCST.CD NE.CON.TOTL.ZS GC.AST.TOTL.GD.ZS
"numeric" "numeric" "numeric" "numeric" "numeric"
EG.GDP.PUSE.KO.PP NE.CON.GOVT.ZS GC.XPN.TOTL.GD.ZS FD.AST.PRVT.GD.ZS SL.UEM.NEET.ZS
"numeric" "numeric" "numeric" "numeric" "numeric"
SL.UEM.1524.FE.ZS SL.SRV.EMPL.ZS SL.FAM.WORK.ZS SL.EMP.TOTL.SP.FE.ZS SL.AGR.EMPL.MA.ZS
"numeric" "numeric" "numeric" "numeric" "numeric"
per_lm_alllm.cov_q5_tot SL.UEM.INTM.MA.ZS SL.TLF.PART.ZS SL.TLF.0714.WK.MA.ZS SL.SRV.0714.MA.ZS
"numeric" "numeric" "numeric" "numeric" "numeric"
SL.FAM.0714.MA.ZS SL.EMP.SELF.MA.ZS SL.AGR.0714.FE.ZS per_lm_alllm.cov_q1_tot SL.UEM.TOTL.FE.ZS
"numeric" "numeric" "numeric" "numeric" "numeric"
SL.UEM.1524.MA.ZS SL.TLF.0714.MA.ZS SL.IND.EMPL.FE.ZS SL.EMP.TOTL.SP.MA.ZS SL.EMP.1524.SP.FE.NE.ZS
"numeric" "numeric" "numeric" "numeric" "numeric"
SL.UEM.TOTL.FE.NE.ZS SL.UEM.1524.MA.NE.ZS SL.TLF.0714.FE.ZS SL.EMP.TOTL.SP.MA.NE.ZS SL.AGR.EMPL.ZS
"numeric" "numeric" "numeric" "numeric" "numeric"
SL.UEM.INTM.ZS SL.SRV.0714.ZS SL.FAM.0714.ZS SL.EMP.SELF.ZS SL.AGR.0714.MA.ZS
"numeric" "numeric" "numeric" "numeric" "numeric"
per_lm_alllm.cov_q2_tot SL.UEM.TOTL.MA.ZS SL.UEM.1524.ZS SL.TLF.0714.SW.FE.ZS SL.IND.EMPL.ZS
"numeric" "numeric" "numeric" "numeric" "numeric"
SL.EMP.TOTL.SP.ZS SL.EMP.1524.SP.MA.NE.ZS SL.UEM.INTM.FE.ZS SL.TLF.PART.MA.ZS SL.SRV.0714.FE.ZS
"numeric" "numeric" "numeric" "numeric" "numeric"
SL.FAM.0714.FE.ZS SL.EMP.SELF.FE.ZS per_lm_alllm.cov_pop_tot SL.UEM.NEET.MA.ZS SL.UEM.1524.FE.NE.ZS
"numeric" "numeric" "numeric" "numeric" "numeric"
SL.TLF.0714.ZS SL.SRV.EMPL.MA.ZS SL.FAM.WORK.MA.ZS SL.EMP.TOTL.SP.FE.NE.ZS SL.AGR.EMPL.FE.ZS
"numeric" "numeric" "numeric" "numeric" "numeric"
per_lm_alllm.cov_q4_tot SL.WAG.0714.MA.ZS SL.UEM.BASC.FE.ZS SL.TLF.0714.SW.ZS SL.SLF.0714.FE.ZS
"numeric" "numeric" "numeric" "numeric" "numeric"
SL.EMP.WORK.FE.ZS SL.EMP.MPYR.FE.ZS SL.WAG.0714.ZS SL.UEM.BASC.MA.ZS SL.SLF.0714.MA.ZS
"numeric" "numeric" "numeric" "numeric" "numeric"
SL.EMP.WORK.MA.ZS SL.EMP.MPYR.MA.ZS per_lm_alllm.adq_pop_tot SL.UEM.NEET.FE.ZS SL.TLF.0714.WK.ZS
"numeric" "numeric" "numeric" "numeric" "numeric"
SL.SRV.EMPL.FE.ZS SL.FAM.WORK.FE.ZS SL.EMP.SMGT.FE.ZS SL.AGR.0714.ZS per_lm_alllm.cov_q3_tot
"numeric" "numeric" "numeric" "numeric" "numeric"
SL.UEM.TOTL.NE.ZS SL.UEM.ADVN.FE.ZS SL.MNF.0714.FE.ZS SL.EMP.VULN.FE.ZS SL.EMP.1524.SP.MA.ZS
"numeric" "numeric" "numeric" "numeric" "numeric"
SL.UEM.BASC.ZS SL.TLF.PART.FE.ZS SL.TLF.0714.WK.FE.ZS SL.SLF.0714.ZS SL.EMP.WORK.ZS
"numeric" "numeric" "numeric" "numeric" "numeric"
SL.EMP.MPYR.ZS per_lm_alllm.ben_q1_tot SL.UEM.TOTL.ZS SL.UEM.ADVN.MA.ZS SL.TLF.0714.SW.MA.ZS
"numeric" "numeric" "numeric" "numeric" "numeric"
SL.MNF.0714.MA.ZS SL.EMP.VULN.MA.ZS SL.EMP.1524.SP.NE.ZS SL.UEM.TOTL.MA.NE.ZS SL.UEM.1524.NE.ZS
"numeric" "numeric" "numeric" "numeric" "numeric"
SL.IND.EMPL.MA.ZS SL.EMP.TOTL.SP.NE.ZS SL.EMP.1524.SP.FE.ZS SL.WAG.0714.FE.ZS SL.UEM.ADVN.ZS
"numeric" "numeric" "numeric" "numeric" "numeric"
SL.MNF.0714.ZS SL.EMP.VULN.ZS SL.EMP.1524.SP.ZS
"numeric" "numeric" "numeric"
# Replace NA values with 0
#nepal_df["TM.TAX.MRCH.WM.AR.ZS"][is.na(nepal_df["TM.TAX.MRCH.WM.AR.ZS"])] <- 0
#nepal_df["NY.GDP.PETR.RT.ZS"][is.na(nepal_df["NY.GDP.PETR.RT.ZS"])] <- 0
# Replace na values with 0 using is.na()
nepal_df[is.na(nepal_df)] <- 0
nepal_df
# Viewing the data after preparing it.
View(nepal_df)
Parameter Selection:
## Sample parameters selection to achieve project objective.
# GC.TAX.GSRV.VA.ZS -> Taxes on goods and services
# GC.TAX.GSRV.CN
# GC.TAX.TOTL.GD.ZS -> Tax revenue (% of GDP)
# IC.TAX.LABR.CP.ZS -> Labor tax and contributions (% of commercial profits) | Labor tax and contributions is the amount of taxes and mandatory contributions on labor paid by the business.
# GC.TAX.YPKG.CN -> Taxes on income, profits and capital gains (current LCU)
# GC.TAX.IMPT.ZS -> Customs and other import duties (% of tax revenue)
# GC.TAX.EXPT.CN -> Taxes on exports (current LCU)
# IC.TAX.TOTL.CP.ZS -> Total tax and contribution rate (% of profit)
# NY.GDP.MKTP.KD -> GDP (constant 2015 US$)
# SL.IND.EMPL.ZS -> Employment in industry (% of total employment) (modeled ILO estimate)
# SL.IND.EMPL.FE.ZS -> Employment in industry, female (% of female employment) (modeled ILO estimate)
# SL.IND.EMPL.MA.ZS -> Employment in industry, male (% of male employment) (modeled ILO estimate)
# SL.AGR.EMPL.ZS -> Employment in agriculture (% of total employment) (modeled ILO estimate)
# SL.AGR.EMPL.FE.ZS -> Employment in agriculture, female (% of female employment) (modeled ILO estimate)
# SL.AGR.EMPL.MA.ZS -> Employment in agriculture, male (% of male employment) (modeled ILO estimate)
## Sample parameter selection to achieve project objective.
# GC.TAX.GSRV.VA.ZS, NY.GDP.MKTP.KD 0.8481471
# GC.TAX.GSRV.VA.ZS, SL.IND.EMPL.ZS 0.8880489
# GC.TAX.GSRV.VA.ZS, SL.IND.EMPL.FE.ZS 0.8928028
# GC.TAX.GSRV.VA.ZS, SL.IND.EMPL.MA.ZS 0.8939309
# GC.TAX.GSRV.VA.ZS, SL.AGR.EMPL.ZS 0.8268747
# GC.TAX.GSRV.VA.ZS, SL.AGR.EMPL.FE.ZS 0.8333567
# GC.TAX.GSRV.VA.ZS, SL.AGR.EMPL.MA.ZS 0.8062022
# GC.TAX.INTT.RV.ZS, SL.IND.EMPL.ZS 0.727295
# GC.TAX.INTT.RV.ZS, SL.IND.EMPL.FE.ZS 0.7059692
# GC.TAX.INTT.RV.ZS, SL.IND.EMPL.MA.ZS 0.7179946
# GC.TAX.TOTL.GD.ZS, SL.IND.EMPL.ZS 0.893035
# GC.TAX.TOTL.GD.ZS, SL.IND.EMPL.FE.ZS 0.8984195
# GC.TAX.TOTL.GD.ZS, SL.IND.EMPL.MA.ZS 0.8992892
# IC.TAX.LABR.CP.ZS
# GC.TAX.YPKG.CN
# GC.TAX.IMPT.ZS
# GC.TAX.EXPT.CN
# IC.TAX.TOTL.CP.ZS
## Sample parameters selection to achieve project objective.
nepal_df <- select(nepal_df, 'YEAR', 'GC.TAX.GSRV.VA.ZS', 'GC.TAX.GSRV.CN', 'GC.TAX.TOTL.GD.ZS', 'IC.TAX.LABR.CP.ZS', 'GC.TAX.YPKG.CN', 'GC.TAX.IMPT.ZS', 'GC.TAX.EXPT.CN', 'IC.TAX.TOTL.CP.ZS', 'NY.GDP.MKTP.KD', 'SL.IND.EMPL.ZS', 'SL.IND.EMPL.FE.ZS', 'SL.IND.EMPL.MA.ZS', 'SL.AGR.EMPL.ZS', 'SL.AGR.EMPL.FE.ZS', 'SL.AGR.EMPL.MA.ZS')
nepal_df
Data Quality: Checking the data
## Checking quality of data in parameters selected.
View(summary(nepal_df))
stat.desc(nepal_df)
Correlation Analysis: Exploring relationship between employment, tax and GDP. Understanding what drives economic activity.
# Finding correlation between each columns in the dataframe
# cor(nepal_df$TM.TAX.MRCH.WM.AR.ZS, nepal_df$NY.GDP.PETR.RT.ZS)
# cor(nepal_df$GC.TAX.TOTL.GD.ZS, nepal_df$SL.IND.EMPL.FE.ZS)
View(cor(nepal_df))
var(nepal_df$GC.TAX.GSRV.VA.ZS)
[1] 26.21113
Time series analysis: Trends/patterns in the data over time
#autoregressive integrated moving average (ARIMA) - need to look at it
p <- ggplot(nepal_df, aes(x=nepal_df$YEAR, y=nepal_df$GC.TAX.GSRV.VA.ZS)) +
geom_line( color="steelblue") +
geom_point() +
xlab("YEAR") +
ylab("GC.TAX.GSRV.VA.ZS")
#scale_x_date(limit=c(as.Date("1960-01-01"),as.Date("2022-12-30"))) +
p
# Check tax and gdp over time
coeff <- 10
tax_color <- "black"
gdp_color <- "steelblue"
ggplot(nepal_df, aes(x=nepal_df$YEAR)) +
geom_line( aes(y=nepal_df$GC.TAX.GSRV.CN), size=0.5, color=tax_color) +
geom_line( aes(y=nepal_df$NY.GDP.MKTP.KD), size=0.5, color=gdp_color) +
geom_point(aes(y = nepal_df$GC.TAX.GSRV.CN), size=2, color=tax_color) +
geom_point(aes(y = nepal_df$NY.GDP.MKTP.KD), size=2, color=gdp_color) +
scale_y_continuous(
# First axis
name = "Taxes on goods and services (current LCU)",
# Second axis
sec.axis = sec_axis(~.*50, name="GDP (constant 2015 US$)")
) +
# theme_ipsum() +
scale_x_continuous(
name = "YEAR"
) +
theme(
axis.title.y = element_text(color = tax_color, size=13),
axis.title.y.right = element_text(color = gdp_color, size=13)
) +
ggtitle("Tax and GDP over time") +
theme(plot.title = element_text(hjust = 0.5)) #Title to be at center
# Checking gdp growth on taxes on goods and services
ggplot(nepal_df, aes(x = GC.TAX.GSRV.CN, y = NY.GDP.MKTP.KD)) +
geom_point() +
geom_smooth() +
xlab("Taxes on goods and services (current LCU)") +
ylab("GDP (constant 2015 US$)") +
scale_x_continuous() +
scale_y_continuous()
# Checking GDP growth on every tax % increase
ggplot(nepal_df, aes(x = GC.TAX.GSRV.VA.ZS, y = NY.GDP.MKTP.KD)) +
geom_point() +
geom_smooth() +
xlab("Taxes on goods and services (% value added of industry and services)") +
ylab("GDP (constant 2015 US$)") +
scale_x_continuous() +
scale_y_continuous()
nepal_df$NY.GDP.MKTP.KD
[1] 3312006963 3375208865 3439686156 3504872049 3768874732 3723528046 3985688368 3923053375 3949552951 4125838151 4232119417
[12] 4181529368 4311901106 4291353333 4563150075 4629611019 4833246135 4979063887 5198428566 5321572986 5198144730 5631772619
[23] 5844618406 5670600395 6219578592 6601765803 6903179359 7020230929 7560564675 7887910507 8253518026 8779114468 9139620604
[34] 9491482290 10271302732 10627557926 11193824413 11758957236 12113653185 12648177008 13432363981 14077102964 14094015643 14650029882
[45] 15336032658 15869600999 16403551941 16963169002 17998709258 18814604917 19720794305 20395606013 21348105727 22100659154 23429236486
[56] 24360795411 24466305357 26662713937 28695046274 30605291409 29880062111 31149050463
Regression:
# R
Cluster:
# C
Add a new chunk by clicking the Insert Chunk button on the toolbar or by pressing Ctrl+Alt+I.
When you save the notebook, an HTML file containing the code and output will be saved alongside it (click the Preview button or press Ctrl+Shift+K to preview the HTML file).
The preview shows you a rendered HTML copy of the contents of the editor. Consequently, unlike Knit, Preview does not run any R code chunks. Instead, the output of the chunk when it was last run in the editor is displayed.
This is an R Markdown Notebook. When you execute code within the notebook, the results appear beneath the code.
Try executing this chunk by clicking the Run button within the chunk or by placing your cursor inside it and pressing Ctrl+Shift+Enter.